package mil.af.amc.adpetracker.util;

import org.springframework.aop.ThrowsAdvice;

import java.lang.reflect.Method;

/**
 * Please Fill in this Javadoc
 *
 * @author TSgt Jason Ferguson
 */

public class ExceptionAdvice implements ThrowsAdvice {

    public void afterThrowing(Exception ex) throws Throwable {
        ex.printStackTrace();
    }

    public void afterThrowing(Method method, Object[] args, Object target, IllegalArgumentException ex) throws Throwable {

        System.out.println(target.getClass().getName() + " threw exception.");
        ex.printStackTrace();
    }
}
